package it.tcm.TeacherClassMate.beans;

import it.tcm.TeacherClassMate.util.Util;

import java.sql.Blob;
import java.util.HashSet;
import java.util.Set;


public class OrderMainBean {
	
	private Integer id;
    private Integer templateId;
	private Integer userId;
	private Blob docx;
	private Blob result;
	private String  classroom;
	private String istitute;
	private String  verificaDate;
	private String  verificaRow;
	private Integer formulaNo;
	private Integer completed;
	private Integer downloaded;
	private Integer saved;
	private Set<OrderRowBean> orderRows = new HashSet<OrderRowBean>(0);
	
	private Integer numEquations;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public Blob getDocx() {
		return docx;
	}
	public void setDocx(Blob docx) {
		this.docx = docx;
	}
	public Blob getResult() {
		return result;
	}
	public void setResult(Blob result) {
		this.result = result;
	}
	public Integer getTemplateId() {
		return templateId;
	}
	public void setTemplateId(Integer templateId) {
		this.templateId = templateId;
	}
	public Integer getUserId() {
		return userId;
	}
	public void setUserId(Integer userId) {
		this.userId = userId;
	}
	public String getClassroom() {
		return classroom;
	}
	public void setClassroom(String classroom) {
		this.classroom = classroom;
	}
	public String getVerificaDate() {
		return verificaDate;
	}
	public void setVerificaDate(String verificaDate) {
		this.verificaDate = verificaDate;
	}
	public String getVerificaRow() {
		return verificaRow;
	}
	public void setVerificaRow(String verificaRow) {
		this.verificaRow = verificaRow;
	}
	public Integer getFormulaNo() {
		return formulaNo;
	}
	public void setFormulaNo(Integer formulaNo) {
		this.formulaNo = formulaNo;
	}
	public Integer getCompleted() {
		return completed;
	}
	public void setCompleted(Integer completed) {
		this.completed = completed;
	}
	public Integer getDownloaded() {
		return downloaded;
	}
	public void setDownloaded(Integer downloaded) {
		this.downloaded = downloaded;
	}
	public Integer getSaved() {
		return saved;
	}
	public void setSaved(Integer saved) {
		this.saved = saved;
	}
	public Set<OrderRowBean> getOrderRows() {
		return orderRows;
	}
	public void setOrderRows(Set<OrderRowBean> orderRows) {
		this.orderRows = orderRows;
	}
	
	public Integer getNumEquations() {
		Integer numtot = 0;
		for (OrderRowBean o : orderRows) {
			if (o.getIdTypology().equals(Util.EQUATIONS_TYPOLOGY)) {
				numtot = numtot + 1;
			}
		}
		return numtot;
	}
	
	public Integer getNumDisequations() {
		Integer numtot = 0;
		for (OrderRowBean o : orderRows) {
			if (o.getIdTypology().equals(Util.DISEQUATIONS_TYPOLOGY)) {
				numtot = numtot + 1;
			}
		}
		return numtot;
	}
	public String getIstitute() {
		return istitute;
	}
	public void setIstitute(String istitute) {
		this.istitute = istitute;
	}
	
	
	
	

}
